home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1988 March / 1988-03.d64 / ml cloner (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  38 lines

  1. 10 rem copyright 1988 compute! publications inc. - all rights reserved
  2. 20 ifpeek(65530)=5then(NULL)15:cp=128
  3. 30 ea=174:sa=193:ifpeek(65530)=164thencp=16:ea=157:sa=178
  4. 40 b=16:z=256:printchr$(14)"[147][144]   [195]opyright 1988 [195][207][205][208][213][212][197]! [208]ub., [201]nc."
  5. 50 printtab(11)"[193]ll [210]ights [210]eserved"
  6. 60 print"";:fori=1to40:printchr$(32);:next:printspc(15)"[145][205]l [195]loner"
  7. 70 input"filename";n$:ifn$=""thenprint"[147]":end
  8. 80 gosub350:ifa=62thenprint"filename not found on this disk.":n$="":goto70
  9. 90 ifathenprint"error: "b$:end
  10. 100 print"loading "n$;:ifcp=128then(NULL)(n$),b0:goto130
  11. 110 poke147,0:ifcp=16thensys43115n$,8,1:sys61516:goto130
  12. 120 sys57812n$,8,1:sys62631
  13. 130 print". completed."
  14. 140 l=asc(a$+chr$(0)):h=asc(b$+chr$(0)):s=l+z*h:e=peek(ea)+z*peek(ea+1)-1
  15. 150 printspc(18)"hex   dec":d=s:gosub330:d=e:hs$=h$:h$="":gosub330
  16. 160 print"starting address: "hs$tab(23)s
  17. 170 print"ending address:   "h$tab(23)e
  18. 180 print"ready to copy this file now (y/n)?";:gosub310:ifk$<>"y"then290
  19. 190 print"want to change the filename (y/n)?";:gosub310
  20. 200 ifk$="y"thenprint"old filename: "n$:input"new filename";n$
  21. 210 print"press <return> for your copy."
  22. 220 getk$:ifk$<>chr$(13)then220
  23. 230 gosub350:ifa>0anda<>62thenprint"error: "b$:goto180
  24. 240 ifa=0thenprint"filename: "n$:print"exists on this disk.":goto180
  25. 250 print"copying "n$;:ifcp=128then(NULL)(n$),b0,p(s)top(e+1):goto280
  26. 260 ifcp=16thensys43115n$,8,1:pokesa,l:pokesa+1,h:sys61860:goto280
  27. 270 sys57812n$,8,1:pokesa,l:pokesa+1,h:sys62957
  28. 280 print". completed.":print"copy it again (y/n)?";:gosub310:ifk$="y"then190
  29. 290 print"want to run this program again (y/n)?";:gosub310:ifk$="y"thenrun
  30. 300 end
  31. 310 getk$:ifk$<>"y"andk$<>"n"then310
  32. 320 print""k$:return
  33. 330 x=((d/b)-int(d/b))*b:h$=chr$(7*abs(x>9)+x+48)+h$:d=(d-x)/b:ifdthen330
  34. 340 return
  35. 350 open15,8,15,"i0:":open8,8,8,"0:"+n$+",p,r"
  36. 360 input#15,a,b$:ifa=0ands=ethenget#8,a$,b$
  37. 370 close8:close15:return
  38.